package com.nep.NEPM.utils;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;

import java.io.IOException;
import java.net.URL;

public class ViewUtils {
    public static Parent loadView( String loadRoad) throws IOException {
        //加载视图
        FXMLLoader fxmlLoader = new FXMLLoader();
        //为fxmlloader设置加载路径
        URL url = ViewUtils.class.getResource(loadRoad);
        //设置加载路径
        fxmlLoader.setLocation(url);
        //加载视图设置根节点
        Parent root = fxmlLoader.load();
        return root;
    }

















}
